package day10;
import java.io.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class Tihuan2 {
    public static void main(String[] args) {

        String a = null;
        String b = "";
        BufferedReader bf = null;
        BufferedWriter bw = null;
        try {
            bf = new BufferedReader(new FileReader("D:\\Documents\\桌面\\Properties02.java"));
            bw = new BufferedWriter(new FileWriter("D:\\Documents\\桌面\\Properties02.java"));
            while ((a = bf.readLine()) != null) {
                b += a;
            }
            System.out.println(b);
            String cc = b.replaceAll("金正恩", "金三胖");
            bw.write(cc);

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (bf != null) {
                try {
                    bf.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if (bw != null) {
                try {
                    bw.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
